package com.dfbz.demo;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_综合案例 {
    public static void main(String[] args) {

        GuiZhouPeople guiZhouPeople = new GuiZhouPeople();
        guiZhouPeople.travel(new JiangXi());            // 贵州人去江西旅游
        guiZhouPeople.chili();                          // 贵州人吃辣
        guiZhouPeople.sour();                           // 贵州人吃酸

        System.out.println("--------------");

        JiangXiPeople jiangXiPeople=new JiangXiPeople();
        jiangXiPeople.chili();                          // 江西人吃辣
        jiangXiPeople.travel(new GuangDong());          // 江西人去广东旅游
    }
}

class GuangDong implements Travel{

    @Override
    public void journey() {
        System.out.println("广州塔...");
        System.out.println("白云山...");
        System.out.println("惠州罗浮山景区...");
        System.out.println("佛山西樵山景区...");
        System.out.println("韶关丹霞山景区...");
    }
}

class GuiZhou implements Travel{

    @Override
    public void journey() {
        System.out.println("黄果树瀑布~");
        System.out.println("赤水丹霞旅游区~");
        System.out.println("镇远古城风景区~");
        System.out.println("梵净山旅游区~");
        System.out.println("安顺龙宫风景区~");
    }
}
class JiangXi implements Travel{

    @Override
    public void journey() {
        System.out.println("滕王阁..");
        System.out.println("梅岭..");
        System.out.println("婺源....");
        System.out.println("景德镇....");
        System.out.println("八一起义纪念馆.....");
    }
}

interface Travel {
    void journey();
}

interface Chili {
    void chili();
}

interface Sour {
    void sour();
}

interface Sweet {
    void sweet();
}

class GuangDongPeople extends People implements Sour, Sweet {
    @Override
    public void sour() {
        System.out.println("吃广东的酸....");
    }

    @Override
    public void sweet() {
        System.out.println("吃广东的甜....");

    }

    @Override
    public void travel(Travel travel) {
        System.out.println("广东人开始旅行....");
        travel.journey();
    }
}

class GuiZhouPeople extends People implements Chili, Sour {
    @Override
    public void chili() {
        System.out.println("辣椒炒辣椒...");
    }

    @Override
    public void sour() {
        System.out.println("吃很酸很酸的东西...");
    }

    @Override
    public void travel(Travel travel) {
        System.out.println("贵州人开始旅行....");
        travel.journey();
    }
}

class JiangXiPeople extends People implements Chili {

    @Override
    public void chili() {
        System.out.println("辣椒炒肉");
    }

    @Override
    public void travel(Travel travel) {
        System.out.println("江西人开始旅行....");
        travel.journey();
    }

}


abstract class People {
    private String name;
    private int age;

    public abstract void travel(Travel travel);

    public void intro() {
        System.out.println("大家好，我叫【" + name + "】，今年【" + age + "】岁");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public People(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public People() {
    }


}
